Top10AreaOwedPanel = function(obj){
	//document.write("<span id='simple-int-chart'></span>")
	var store = new Ext.data.JsonStore(
		{
			url:__ctxPath+'/back/area/gettop10areaoweddata.html',
			autoLoad:true,
			root:'data',
			fields:['value','label']
		}
	);
	
	
	var chartpanel = new Ext.Panel(
		{
			layout:'fit',
			width:200,
			height:200,
			listeners:{ 
			  'afterrender' : function(panel){
			  		var str = '<span id="simple-int-chart"></span>';
			  		Ext.DomHelper.insertHtml('afterBegin',Ext.getDom('myspan'),str);
			  		try{
			  			var myChart = new FusionCharts( __ctxPath+"/assert/swf/Column2D.swf", "myChartId-sim", "100%", "200", "0", "0" );
			  			 var dataurl = __ctxPath+'/back/area/gettop10areaoweddata.html';
			       		 var datajson = __ctxPath+'/back/js/payments/anylise/Data.json';
			        	myChart.setJSONUrl(dataurl);
			        	//myChart.setJSONData(JSONObject);
			        	myChart.render("simple-int-chart");
			  		}catch(e){
			  		
			  		}
			  		//var myChart = new FusionCharts( __ctxPath+"/assert/swf/Column3D.swf", "myChartId-sim", "100%", "300", "0", "0" );
			       
			        
			       // console.log(FusionCharts('myChartId-sim').getJSONData());
			  }  
			},
			html:'<span id="myspan"></span>'
		}
	);
	
	
	var cm = new Ext.grid.ColumnModel(
		[
			new Ext.grid.RowNumberer(),
			{header:'小区名称',dataIndex:'label',sortable: true,width:200},
			{header:'用户数量',dataIndex:'value',sortable: true,width:200}
		]
	);
	
	var datapanel = new Ext.grid.GridPanel(
		{
			store:store,
			autoScroll:true,
			cm:cm,
			width:200,
			height:300
		}
	);
	
	
	
    
        
	var centerpanel = new Ext.Panel(
		{
			layout:'vbox',
			border:false,
			layoutConfig: {
			    align : 'stretch',
			    pack  : 'start'
			},
			items: [
			    {
			    	layout:'fit',
			    	border:false,
			    	items:[chartpanel]
			    },{
			    	layout:'fit',
			    	border:true,
			    	items:[datapanel]
			    }
			]		
		}
	);
	
	
	
	var config = {
		layout:'fit',
		items:[centerpanel],
		height:500,
		title:'小区用户统计',
		iconCls:'zoom',
		id:'Top10AreaOwedPanel'
	};
	
	
	
	Top10AreaOwedPanel.superclass.constructor.call(this,config);
};
Ext.extend(Top10AreaOwedPanel,Ext.Panel);